import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { ClassroomService } from './classroom.service';
import { CreateClassroomDto } from './dto/create-classroom.dto';
import { UpdateClassroomDto } from './dto/update-classroom.dto';
import { Classroom } from './entities/classroom.entity';

@Controller('classroom')
export class ClassroomController {
  constructor(private readonly classroomService: ClassroomService) {}
  // 创建班级
  @Post("/createClassroom")
  create(@Body() classroom: CreateClassroomDto) {
    return this.classroomService.create(classroom);
  }
  // 查询目标班级所有学生
  @Get(':class_id/students')
  async findClassWithStudents(@Param('class_id') class_id: string): Promise<any> {
    return await this.classroomService.findClassWithStudents(class_id);
  }
}
